﻿using System;
using System.Linq;
using System.Text;
using SqlSugar;

namespace Crossroad.System.User.Model
{
    ///<summary>
    ///平台用户 user_app
    ///</summary>
    [SugarTable("user_app")]
    public partial class UserApp : ModelContext
    {
        public UserApp()
        {
            LoadDefVal();
        }

        public UserApp(bool loadDef)
        {
            if (loadDef)
                LoadDefVal();
        }

        private void LoadDefVal()
        {
            this.creatorId = Convert.ToInt32("0");
            this.createTime = Convert.ToInt32("0");
        }

        /// <summary>
        /// Desc:用户id
        /// Default:
        /// Nullable:False
        /// </summary>           
        [SugarColumn(IsPrimaryKey = true, ColumnName = "user_id")]
        public int userId { get; set; }

        /// <summary>
        /// Desc:应用id
        /// Default:
        /// Nullable:False
        /// </summary>           
        [SugarColumn(IsPrimaryKey = true, ColumnName = "app_id")]
        public string appId { get; set; }

        /// <summary>
        /// 登陆方式
        /// </summary>
        [SugarColumn(ColumnName = "login_mode")]
        public string loginMode { get; set; }

        /// <summary>
        /// Desc:角色id
        /// Default:
        /// Nullable:False
        /// </summary>           
        [SugarColumn(ColumnName = "role_id")]
        public int roleId { get; set; }

        /// <summary>
        /// 组织架构id
        /// </summary>
        [SugarColumn(ColumnName = "organization_id")]
        public int organizationId { get; set; }

        /// <summary>
        /// Desc:创建时间
        /// Default:0
        /// Nullable:True
        /// </summary>           
        [SugarColumn(ColumnName = "create_time")]
        public int? createTime { get; set; }

        /// <summary>
        /// Desc:创建人
        /// Default:0
        /// Nullable:True
        /// </summary>           
        [SugarColumn(ColumnName = "creator_id")]
        public int? creatorId { get; set; }

        #region 扩展属性

        /// <summary>
        /// 用户信息
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public UserInfo user { get; set; }

        #endregion
    }
}
